//
//  taobaoke_items_convert_response.m
//  yuimall_Iphone
//
//  Created by yuike6 yuike6 on 12-4-16.
//  Copyright (c) 2012年 yuike. All rights reserved.
//

#import "taobaoke_items_convert_response.h"
#import "header.h"

@implementation taobaoke_items_convert_response
@synthesize total_results;
@synthesize taobaoke_items;

-(void) dealloc
{
    YRelease(taobaoke_items);
    [super dealloc];
}


-(void) privateInit
{
    self.total_results = [[self.xmlTree valueAtPath:@"taobaoke_items_convert_response/total_results"] intValue];
    
    NSMutableArray * tmp_taobao_items = [[NSMutableArray alloc] init];
    
    for (XMLParsedTree * subTree in [self.xmlTree childrenTreeAtPath:@"taobaoke_items_convert_response/taobaoke_items" nodeName:@"taobaoke_item"]) 
    {
        taobaoke_item * item = [[taobaoke_item alloc] initWithXmlTree:subTree];
        [tmp_taobao_items addObject:item];
        YRelease(item);
    }
    
    self.taobaoke_items = tmp_taobao_items;
    YRelease(tmp_taobao_items);
}

-(id) initWithXmlTree:(XMLParsedTree *)tree
{
    self = [super initWithXmlTree:tree];
    if (self) {
        [self privateInit];
    }
    
    return self;
}


-(id) initWithXmlString:(NSString *)xmlString
{
    self = [super initWithXmlString:xmlString];
    if (self) {
        [self privateInit];
    }
    return self;
}

-(id) initWithXmlData:(NSData *)xmlData
{
    self = [super initWithXmlData:xmlData];
    if (self) {
        [self privateInit];
    }
    return self;
}
@end
